import traceback

def log_msg(msg):
    with open('./d2ext/logs/d2ext.log', 'w') as log:
        log.write(msg)


def on_drop_treauser_class(pGame, pSource, pKiller, pTC_D2TCExShortStrc, nQuality, nIlvl, dwZero, dwZero2, dwZero3, dwZero4):
    log_msg('on_drop_treauser_class, pKiller=%s' % pKiller.nUnitType)
    try:
        import D2Ext
        log_msg(str(dir(D2Ext)))
        D2Ext.D2DropTreasureClass(pGame, pSource, pKiller, pTC_D2TCExShortStrc, nQuality, nIlvl, dwZero, dwZero2, dwZero3, dwZero4)
    except Exception as e:
        log_msg(traceback.format_exc())
